#!/usr/bin/env python
# -*- coding:utf-8 -*-

if __name__=="__main__":
    # cont = (11, 2, 5, 3, 23, (1, 3, 1, 55), ["kji", 223, 90])
    # print(cont[2])
    # print(cont[0:3])
    # print(cont[5][1])
    # print(len(cont))
    # print(cont[len(cont)-1][0].upper())
    cont = "大半夜的小明在被窝看小说！"
    #方法一
    # new_cont = cont[::-1]
    # print(new_cont)

    #方法二
    index = len(cont)-1
    new_cont = ""
    for i in range(index,-1,-1):
        new_cont = new_cont + cont[i]
    print(new_cont)

    #方法三
    # index = len(cont)-1
    # new_cont = ""
    # while index>=0:
    #     new_cont = new_cont + cont[index]
    #     index -= 1
    # print(new_cont)
